SGSetVideoCompressor
TheSGSetVideoCompressor
function allows you to specify many of the parameters that control image compression of the video data captured by a video channel.
pascal ComponentResult SGSetVideoCompressor (SGChannel c, short depth, CompressorComponent compressor, CodecQ spatialQuality, CodecQ temporalQuality, long keyFrameRate);
c
- Specifies the reference that identifies the channel for this operation. You obtain this reference from the
SGNewChannel
function, described on page 5-29.depth
- Specifies the depth at which the image is likely to be viewed. Image compressors may use this as an indication of the color or grayscale resolution of the compressed images. If you set this parameter to 0, the sequence grabber component determines the appropriate value for the source image. Values of 1, 2, 4, 8, 16, 24, and 32 indicate the number of bits per pixel for color images. Values of 33, 34, 36, and 40 indicate 1-bit, 2-bit, 4-bit, and 8-bit grayscale, respectively, for grayscale images. Your program can determine which depths are supported by a given compressor by examining the compressor information structure returned by the Image Compression Manager's
GetCodecInfo
function (see the chapter "Image Compression Manager" in Inside Macintosh: QuickTime for more information on theGetCodecInfo
function).- Set this parameter to 0 to leave the depth unchanged.
compressor
- Specifies the image compressor identifier. Specify a particular compressor by setting this parameter to its compressor identifier. You can obtain this identifier from the Image Compression Manager's
GetCodecNameList
function. Set this parameter to 0 to leave the compressor unchanged.spatialQuality
- Specifies the desired compressed image quality. See the chapter "Image Compression Manager" in Inside Macintosh: QuickTime for valid values.
temporalQuality
- Specifies the desired sequence temporal quality. This parameter governs the level of compression you desire with respect to information between successive frames in the sequence. Set this parameter to 0 to prevent the image compressor from applying temporal compression to the sequence. See the chapter "Image Compression Manager" in Inside Macintosh: QuickTime for other valid values.
keyFrameRate
- Specifies the maximum number of frames allowed between key frames. Key frames provide points from which a temporally compressed sequence may be decompressed. Use this parameter to control the frequency at which the image compressor places key frames into the compressed sequence. For more information about key frames, see the chapter "Image Compression Manager" in Inside Macintosh: QuickTime.
- The compressor determines the optimum placement for key frames based upon the amount of redundancy between adjacent images in the sequence. Consequently, the compressor may insert key frames more frequently than you have requested. However, the compressor will never place key frames less often than is indicated by the setting of the
keyFrameRate
parameter. The compressor ignores this parameter if you have not requested temporal compression (that is, you have set thetemporalQuality
parameter to 0).DESCRIPTION
Typically, you are interested in setting only one or two of these parameters. You can call theSGGetVideoCompressor
function to retrieve the values of all of the parameters, and you can then use that information to supply values for the parameters you do not wish to change.SPECIAL CONSIDERATIONS
You may call this function during a record operation or after you have prepared the sequence grabber component for a record operation only if you set thedepth
andcompressor
parameters to 0. This allows you to work with the quality or key frame rate configuration while you are capturing a sequence.RESULT CODES
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help